package com.yunxi.service.dubboService.impl.dealer.bizToBaseData;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.yunxi.bizToBaseData.pojo.PartnerInfoReqVO;
import com.yunxi.bizToBaseData.pojo.PartnerInfoRespVO;
import com.yunxi.bizToBaseData.service.STOSPartnerDubboService;
import com.yunxi.dealer.pojo.PartnerVO;
import com.yunxi.model.dealer.PartnerType;
import com.yunxi.service.localService.dealer.PartnerService;
import com.yunxi.service.localService.dealer.PartnerTypeService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class STOSPartnerDubboServiceImpl implements STOSPartnerDubboService {

    @Autowired
    @Qualifier(value = "partnerServiceImpl")
    PartnerService partnerService;

    @Override
    @Transactional
    @LcnTransaction
    public PartnerInfoRespVO queryPartnerInfoByCondition(PartnerInfoReqVO vo) {
         PartnerVO v = new PartnerVO();
         v.setPartnerCode(vo.getPartnerCode());
         List resultList = partnerService.listSel(v);

         if(resultList != null && resultList.size() > 0){
             PartnerVO result = (PartnerVO)resultList.get(0);
             PartnerInfoRespVO respVO = new PartnerInfoRespVO();
             BeanUtils.copyProperties(result,respVO);
             return respVO;
         }

         return null;
    }
}
